<template>
<div>

<el-menu
	:default-active="pageInfo.menuIndex + ''"
  >
  <el-submenu v-for="(item, index) in menuList" :index="index + ''">
    <template slot="title">
      <i class="el-icon-location"></i>
      <span>{{item.name}}</span>
    </template>
	  <el-menu-item v-for="(item1, index1) in item.children" 
	  :index="pageInfo.systemIndex + '_' + index + '_' + index1"
	  @click.native="chooseMenu(item1, pageInfo.systemIndex + '_' + index + '_' + index1)"
	  >{{item1.name}}</el-menu-item>
	 <!--  <el-menu-item index="1-2">选项2</el-menu-item>
	  <el-menu-item index="1-3">选项3</el-menu-item> -->
    <!-- <el-submenu index="1-4">
      <template slot="title">选项4</template>
      <el-menu-item index="1-4-1">选项1</el-menu-item>
    </el-submenu> -->
  </el-submenu>

</el-menu>

</div>
</template>

<script>

import { mapGetters } from 'vuex'

export default {
	
	name : 'menu1',
	
	data () {
		return {
		  	
		}
	},

	props : {

	},

	components : {
		
	},

	computed : {
		...mapGetters([
			'menuList',
			'pageInfo',
		]),
	},

	methods : {
		chooseMenu (item, index) {
			this.$store.commit('setMenuIndex', index);
			this.$router.push({
				name : item.href,
			});
		},
	},

	watch : {
	    
	},

	mounted () {
		
	},

}
</script>

<style scoped>

</style>
